package com.mvp.shq.washer;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.mvp.shq.washer.entity.BaseEvent;
import com.mvp.shq.washer.rxbus.RxBus;


public class Main2Activity extends AppCompatActivity {
    private TextView tvTest;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);
        RxBus.get().register(this);
        init();
    }
    private void init(){
        tvTest = (TextView)findViewById(R.id.tv_test2);
        tvTest.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                BaseEvent event = new BaseEvent();
                event.setMsg("猜猜你妈不");
                RxBus.get().send(1,event);
            }
        });
    }


    @Override
    protected void onDestroy() {
        super.onDestroy();
        RxBus.get().unRegister(this);
    }
}
